package com.qf.day03;

import java.util.Scanner;

/*
循环录入5个人人的成绩，求最大成绩、最小成绩、平均成绩
 */
public class lianxiDemo {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        double sum = 0 ;
        double max = 0 ;
        double min = 100 ;
        for (int i = 1; i < 6; i++) {
            System.out.println("请输入成绩：");
            double score = scanner.nextDouble();
            sum+=score;
            if(score>max){
                max = score ;
            }
            if(score<min){
                min=score;
            }
        }
        System.out.println("平均值："+sum/5);
        System.out.println("最大值："+max);
        System.out.println("最小值："+min);
    }
}
